<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\User;
use Spatie\Permission\Models\Permission;

class SeedGlobalData extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $user = [
            'name' => 'admin',
            'email' => '542554038@qq.com',
            'password' => bcrypt('123456'),
            'auth' => 3,
        ];

        User::create($user);

        Permission::create(['name' => 'employee.index', 'desc_name' => '员工信息']);
        Permission::create(['name' => 'customer.index', 'desc_name' => '客户信息']);
        Permission::create(['name' => 'users.index', 'desc_name' => '员工账号']);
        Permission::create(['name' => 'permissions.index', 'desc_name' => '权限设置']);
        Permission::create(['name' => 'loans.index', 'desc_name' => '贷款申请']);
        Permission::create(['name' => 'examine.index', 'desc_name' => '客户申请业务']);

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
